package jehc.djshi.log.service.impl;

import jehc.djshi.common.base.BaseService;
import jehc.djshi.common.util.ExceptionUtil;
import jehc.djshi.log.dao.XtStartStopLogDao;
import jehc.djshi.log.model.XtStartStopLog;
import jehc.djshi.log.service.XtStartStopLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * @Desc 服务器启动与关闭日志
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service
public class XtStartStopLogServiceImpl extends BaseService implements XtStartStopLogService {
	@Autowired
	private XtStartStopLogDao xtStartStopLogDao;
	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<XtStartStopLog> getXtStartStopLogListByCondition(Map<String,Object> condition){
		try{
			return xtStartStopLogDao.getXtStartStopLogListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 查询对象
	* @param xt_start_stop_log_id 
	* @return
	*/
	public XtStartStopLog getXtStartStopLogById(String xt_start_stop_log_id){
		try{
			return xtStartStopLogDao.getXtStartStopLogById(xt_start_stop_log_id);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 添加
	* @param xtStartStopLog
	* @return
	*/
	public int addXtStartStopLog(XtStartStopLog xtStartStopLog){
		int i = 0;
		try {
			i = xtStartStopLogDao.addXtStartStopLog(xtStartStopLog);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 修改
	* @param xtStartStopLog
	* @return
	*/
	public int updateXtStartStopLog(XtStartStopLog xtStartStopLog){
		int i = 0;
		try {
			i = xtStartStopLogDao.updateXtStartStopLog(xtStartStopLog);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delXtStartStopLog(Map<String,Object> condition){
		int i = 0;
		try {
			i = xtStartStopLogDao.delXtStartStopLog(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
